package com.godme.rocket.repo;


import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class OrderRepository {

    private final static Map<String, Boolean> orders = new ConcurrentHashMap<>();

    public void insertOrder(String oid){
        updateOrder(oid, false);
    }

    public void updateOrder(String oid, Boolean status){
        orders.put(oid, status);
    }

    public Boolean queryStatusByOid(String oid){
        return orders.get(oid);
    }

    public Map<String, Boolean> queryAll(){
        return orders;
    }
}
